 function isnull(tagname,errortag,errormsg) {
		//alert(document.getElementsByName(tagname)[0].value);
		if(document.getElementsByName(tagname)[0].value==""){
			document.getElementById(errortag).innerHTML=errormsg;
			 //alert("����Ϊ��");
			return false;
		} else {
			document.getElementById(errortag).innerHTML="";
			return true;
			}
	}
function isEmail(tagname,errortag,errormsg){
		var email = document.getElementById(tagname).value;
		if(email!="") {
			if (!checkEmail(email)) {
				document.getElementById(errortag).innerHTML=errormsg;
				return false;
			} else {
				document.getElementById(errortag).innerHTML="";
				return true;
			}
		}
		
	}
 function checkEmail(email) {
		var s = email;
		var pattern = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
		///^[a-zA-Z0-9_\-]{1,}@[a-zA-Z0-9_\-]{1,}\.[a-zA-Z0-9_\-.]{1,}$/;

		if (s != "") {
			if (!pattern.exec(s)) {
				return false;
			}else{
				return true;
			}
		}
	}
	function isphone(tagname,errortag,errormsg){
		var phone = document.getElementById(tagname).value;
		if(phone!="") {
			if (!checkTel(phone)) {
				document.getElementById(errortag).innerHTML=errormsg;
				return false;
			} else {
				document.getElementById(errortag).innerHTML="";
				return true;
			}
		}
		
	}
	function checkTel(phone) {
	var s = phone;
	var pattern = /^(([0\+]\d{2,3}-)?(0\d{2,3})-)(\d{7,8})(-(\d{3,}))?$/;
	if (!pattern.exec(s)) {
		return false;
	}else{
		return true;
	}
}
	function isTelephoneNum(tagname,errortag,errormsg){
		var phone = document.getElementById(tagname).value;
		if(phone!="") {
			if (!checkTelephoneNum(phone)) {
				document.getElementById(errortag).innerHTML=errormsg;
				return false;
			} else {
				document.getElementById(errortag).innerHTML="";
				return true;
			}
		}
		
	}
	function checkTelephoneNum(num) {
		var regu = /^[1]([3-8][0-9]{1}|59|58|88|89)[0-9]{8}$/;
		var req = new RegExp(regu);
		if (num.length == 11 && req.test(num)) {
			return true;
		} else {
			return false;
		}
	}
	
	function isLength(tagname,errortag,errormsg,len) {
		var dvalue = document.getElementById(tagname).value;
		if(dvalue!="") {
		var strlen = Len(dvalue);
			if(strlen>len) {
				document.getElementById(errortag).innerHTML=errormsg;
				return false;
			} else {
				document.getElementById(errortag).innerHTML="";
				return true;
			}
		}
	}
	function checkNumber(tagname,errortag,errormsg) {
		var value = Trim(document.getElementsByName(tagname)[0].value);
		if(value!=""){
			if(isnumber(value)==false) {
				document.getElementById(errortag).innerHTML=errormsg;
				return false;
			} else {
				document.getElementById(errortag).innerHTML="";
				return true;
			}
			}
		}
	function isnumber(str) {
		var number_chars = "1234567890.";
		var i;
		for (i = 0; i < str.length; i++) {
			if (number_chars.indexOf(str.charAt(i)) == -1)
				return false;
		}
	}
